package com.qianyu.project.core.context.handler;

import org.springframework.context.ApplicationContext;
import org.springframework.util.ObjectUtils;

/**
 * @author gs
 * @date create in 2021/1/8 21:26
 */
public class FlowHandlerFactoryBean {

    public FlowFinishedHandler doCreateHandler(String key, Class type, ApplicationContext context){
        if(ObjectUtils.isEmpty(key) || ObjectUtils.isEmpty(type)){
            return null;
        }
        return (FlowFinishedHandler) context.getBean(type);
    }
}
